home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / turbo_part1.lha / modula / m2 / FastStorage.def < prev    next >
Encoding:
Modula Definition  |  1995-01-24  |  692 b   |  17 lines

  1. DEFINITION MODULE FastStorage ;
  2.  
  3. FROM SYSTEM IMPORT ADDRESS ;
  4.  
  5. PROCEDURE ALLOCATE( VAR p : ADDRESS ; size : LONGINT ) ;
  6. (* Like Storage.ALLOCATE but much faster.                 *)
  7. (* Allocates memory in blocks of 16K. And chops them up as required.     *)
  8. (* This avoids calling the OS every time you need 16bytes of memory etc. *)
  9. (* If you ask for more than 16K in one go, then this will be allocated   *)
  10. (* as normal.                                     *)
  11. (* The disadvantage is that all the allocated memory can only be freed   *)
  12. (* at program exit                                 *)
  13. (* DO NOT TRY TO FREE ANY MEMORY ALLOCATED USING THIS PROCEDURE !!     *)
  14. (* It will be freed for you when the program terminates.         *)
  15.  
  16. END FastStorage.
  17.